﻿using System;
using System.Windows.Forms;

namespace RabbitDownload.WebSite.RomeSound
{
    public partial class RomeSoundControl : UserControl
    {
        public RomeSoundControl()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ListviewAddHelper();
        }

        private void ListviewAddHelper()
        {
            listView1.Items.Clear();
            foreach (string line in RomeeSoundScanner.StartScanner(textBox1.Text))
            {
                listView1.Items.Add(line);
            }
        }

        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0) return;
            else
            {
                richTextBox1.Text = listView1.SelectedItems[0].Text.Trim();
            }
        }
    }
}